#
# libgist driver program build file
#

#
# This file is part of libgist.
#
# libgist is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# libgist is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with libgist; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
#

#
# REVISION HISTORY
#
# $HeadURL: http://libgist.googlecode.com/svn/branches/siagian_dev/drv/CMakeLists.txt $
# $Id: CMakeLists.txt 134 2012-02-10 06:09:33Z christian.g.siagian@gmail.com $
#

# Min cmake version
cmake_minimum_required(VERSION 2.8)

# Project name and version
project(gistdrv)
set(gistdrv_VERSION_MAJOR 0)
set(gistdrv_VERSION_MINOR 3)
set(gistdrv_VERSION_PATCH 1)
configure_file("${PROJECT_SOURCE_DIR}/gistdrv_version.cc.in"
               "${PROJECT_SOURCE_DIR}/gistdrv_version.cc")

# Library checks
find_package(PythonLibs REQUIRED)
find_package(Boost COMPONENTS program_options python thread REQUIRED)

find_package(Boost COMPONENTS filesystem system) # optional
if(Boost_FILESYSTEM_FOUND)
   add_definitions(-DGISTDRV_HAVE_BOOST_FILESYSTEM)
endif(Boost_FILESYSTEM_FOUND)

find_package(DevIL REQUIRED)

# Libraries to link in
set(gistdrv_LIBS ${gistdrv_LIBS} gist
                 ${Boost_LIBRARIES} ${PYTHON_LIBRARIES}
                 ${ILU_LIBRARIES} ${IL_LIBRARIES})
link_directories(${gist_BINARY_DIR})

# Compiler flags
add_definitions(-Wall -Wextra)
include_directories(${gist_SOURCE_DIR} ${PYTHON_INCLUDE_DIRS})

# Source files for driver program
set(gistdrv_SOURCES main.cc gistdrv_version.cc exceptions.cc config.cc
                    file_utils.cc math_utils.cc image.cc
                    action.cc train.cc
                    algorithm_tester.cc
                    lazebnik_driver.cc siagian_driver.cc)

# Final output from sources
add_executable(gistdrv ${gistdrv_SOURCES})
target_link_libraries(gistdrv ${gistdrv_LIBS})
set_target_properties(gistdrv PROPERTIES OUTPUT_NAME gist)
